package com.gcsoftware.web.mapper;

import com.gcsoftware.web.beans.T_GW_CHANGES;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created by qs on 2018/3/28.
 */
@Mapper
public interface T_GW_CHANGES_MAPPER {

    @Select("<script>SELECT C_CHANGE_TYPE ,C_VERIFY_ID ,C_CHANGE_FIELD ,C_CHANGE_VALUE ,N_REALM_NO  FROM T_GW_CHANGES WHERE c_VERIFY_ID = #{c_VERIFY_ID} <when test='null != c_CHANGE_TYPE'> AND c_CHANGE_TYPE=#{c_CHANGE_TYPE}</when></script>")
    public List<T_GW_CHANGES> queryForList(@Param(value = "c_VERIFY_ID") String c_VERIFY_ID , @Param(value = "c_CHANGE_TYPE") String c_CHANGE_TYPE);

    @Insert("INSERT INTO T_GW_CHANGES (C_CHANGE_TYPE ,C_VERIFY_ID ,C_CHANGE_FIELD ,C_CHANGE_VALUE ,c_USER_ID,N_REALM_NO) " +
            "VALUES(#{c_CHANGE_TYPE},#{c_VERIFY_ID},#{c_CHANGE_FIELD},#{c_CHANGE_VALUE},#{c_USER_ID},#{n_REALM_NO})")
    public int insertChange(T_GW_CHANGES change) ;
}
